package com.yaorange.module.association.controller;

import cn.hutool.core.io.resource.Resource;
import com.yaorange.module.association.service.AssociationInfoService;
import com.yaorange.pojo.BsAssociation;
import com.yaorange.response.Result;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.core.io.FileSystemResource;
import org.springframework.http.ResponseEntity;
import org.springframework.web.bind.annotation.*;

import java.nio.file.Path;
import java.nio.file.Paths;

@RestController
@RequestMapping("/association/info")
public class AssociationInfoController {
    @Autowired
    AssociationInfoService associationInfoService;
    @PutMapping
    public Result createInfo(@RequestBody BsAssociation bsAssociation) {
        associationInfoService.createInfo(bsAssociation);
        return Result.success();
    }

    @GetMapping
    public Result<BsAssociation> getInfo() {
        return Result.success(associationInfoService.getOne());
    }

}
